<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>audioTest</title>
    <style>
        body{
            background-color:gray;
        }
        .box {
            width: 20px;
            height: 15px;
            line-height: 15px;
            text-align: center;
            background-color: orange;
            position: absolute;
            top: 50%;
            left: 50%;
            margin-left: -10px;
            margin-top: -7.5px;
        }
        a{
            font-size:3em;
        }
    </style>
</head>
<body>
    <div class="box">
        <audio controls autoplay loop name="media" id="my-bgm" style="margin-left: -10px;margin-top: -10px;">
            <source src="./01.mp3" type="audio/mpeg">
        </audio>
    </div>
</body>
<script>
    let ele=document.getElementById("my-bgm");
    let loadAudio;
    ele.onload=function(){
        loadAudio="load complete"
    }
    function test(){
        backToEts.test("backToEts")
    }
    function enableMute() { 
        var myVid = document.getElementById("my-bgm");
        myVid.muted = true;
        return myVid.muted
    }
    function disableMute() { 
        var myVid = document.getElementById("my-bgm");
        myVid.muted = false;
        return myVid.muted
    }
    function checkMute() {
        var myVid = document.getElementById("my-bgm");
        if ( myVid.muted ) {
            return "muted"
        } else {
            return "unmuted"
        }
    }
    function play() {
        var myVid = document.getElementById("my-bgm");
        if (myVid.paused) {
            myVid.play()
        }
        return !myVid.paused
    }
    function pause() {
        var myVid = document.getElementById("my-bgm");
        myVid.pause()
        return myVid.paused
    }

    function isPlaying() {
        var myVid = document.getElementById("my-bgm");
        return !myVid.paused
    }

</script>
</html>